﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataSync.Entity
{
    public class DBConfig : CollectConfigBase
    {
        public DataBaseType DBType { get; set; }
        public string ConnString { get; set; }
        public Dictionary<string, string> Sqls { get; set; }
        /// <summary>
        /// 处理表名
        /// </summary>
        public string TableName { get; set; }
    }

    public class DBOutputConfig : DBConfig
    {
        /// <summary>
        /// 同步类型
        /// </summary>
        public string ProcType { get; set; }
        /// <summary>
        /// 检查是否存在时的key列 
        /// </summary>
        public List<string> KeyCol { get; set; }
    }

    /// <summary>
    /// DB读取配置
    /// </summary>
    public class DBReaderConfig : DBConfig
    {
        /// <summary>
        /// 批量提交数据条数
        /// </summary>
        public int BathDataCount { get; set; }
    }
    /// <summary>
    /// DB解析配置
    /// </summary>
    public class DBParseConfig : LineParseConfig
    {
    }

    public enum DataBaseType
    {
        SqlServer,
        //SqlServerCE,
        MySql,
        PostgreSQL,
        Oracle,
        //SQLite,
        Informix,
        MsAccess,
        OleDB
    }
}
